package com.cskaoyan.wordmemorize.controller.admin;

import com.cskaoyan.wordmemorize.common.result.Result;
import com.cskaoyan.wordmemorize.dto.admin.DeleteSubTopicOperateDTO;
import com.cskaoyan.wordmemorize.service.TopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/subtopic")
public class SubTopicController
{

    @Autowired
    private TopicService topicService;


    // 删除选词填空小题
    @DeleteMapping("/{id}")
    public Result<DeleteSubTopicOperateDTO> deleteSubTopic(@PathVariable Long id)
    {
        DeleteSubTopicOperateDTO deleteSub = topicService.deleteSubTopic(id);
        return Result.ok(deleteSub);
    }

}
